package com.atguigu.userprofile.common.dao

import com.atguigu.userprofile.common.bean.TaskTagRule
import com.atguigu.userprofile.common.util.MySQLUtil

object TaskTagRuleDAO {

  def getTaskTagRule(taskId:String): List[TaskTagRule] ={
      val sql=s""" select  tr.id,tr.tag_id,tr.task_id,tr.query_value,
         | tr.sub_tag_id,ti.tag_name as sub_tag_value
         | from task_tag_rule tr join tag_info ti  on tr.sub_tag_id=ti.id
         | where task_id='$taskId' """.stripMargin

    val taskTagRuleList: List[TaskTagRule] = MySQLUtil.queryList(sql, classOf[TaskTagRule], true)
    taskTagRuleList

  }

}
